package SortAlgotithm;

/**
 * Created by lenovo】 on 2017/3/9.
 */
public class BubbleSort {
    public void BubbleSort(int [] list) {
        int len = list.length;
        for (int i = 1 ; i < len ; i++) {
            for (int j = 0 ; j< len - i; j ++) {
                if (i == 5) {
                    break;
                }
                if (list[j + 1] > list[j]) {
                    int temp = list[j];
                    list[j] = list[j + 1];
                    list[j + 1] = temp;
                }
            }
        }
    }
}
